package com.ht.sps.nh.bui.model;

import com.ht.sps.nh.entity.TreeMenu;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by steven on 2015-1-7.
 */
public class SimulateSideEnumNode {
    private int pid = 0;
    private long id;
    private String text;
    private int menuLevel;
    private TreeMenu treeMenu;
    private List<SimulateSideEnumNode> items = new ArrayList();

    public SimulateSideEnumNode(){

    }

    public SimulateSideEnumNode(int pid, int id, String text, int menuLevel, TreeMenu treeMenu,List<SimulateSideEnumNode> items) {
        this.pid = pid;
        this.id = id;
        this.text = text;
        this.menuLevel = menuLevel;
        this.treeMenu = treeMenu;
        if (items != null && items.size() > 0) {
            this.items.addAll(items);
        }
    }

    public SimulateSideEnumNode(TreeMenu treeMenu) {
        this.pid = treeMenu.getParentId();
        this.id = treeMenu.getId();
        this.text = treeMenu.getMenuName();
        this.menuLevel = treeMenu.getMenuLevel();
        this.treeMenu = treeMenu;
    }

    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public int getMenuLevel() {
        return menuLevel;
    }

    public void setMenuLevel(int menuLevel) {
        this.menuLevel = menuLevel;
    }

    public TreeMenu getTreeMenu() {
        return treeMenu;
    }

    public void setTreeMenu(TreeMenu treeMenu) {
        this.treeMenu = treeMenu;
    }

    public List<SimulateSideEnumNode> getItems() {
        return items;
    }

    public void setItems(List<SimulateSideEnumNode> items) {
        this.items = items;
    }
}
